package com.lcxsoft.feign.clients;

import com.lcxsoft.commonutils.R;

import com.lcxsoft.feign.entity.CustomUser;
import com.lcxsoft.feign.entity.School;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;

@FeignClient(value = "service-user")
public interface UserClient {

    /**
     * 充值余额
     * @param tottleAmount
     * @param userId
     * @return
     */
    @PostMapping("/foodbox/userservice/customerUserUrl/chargeById")
    R updateUserInfo(@RequestParam("tottleAmount") BigDecimal tottleAmount, @RequestParam("userId") String userId);

    /**
     * 根据UserId获取schoolId
     * @param userId
     * @return
     */
    @PostMapping("/foodbox/userservice/schoolUrl/querySchoolByUserId")
    String querySchoolByUserId(String userId);

    /**
     * 根据schoolId获取school对象
     * @param schoolId
     * @return
     */
    @PostMapping("/foodbox/userservice/schoolUrl/querySchoolBySchoolId")
    School querySchoolBySchoolId(@RequestBody String schoolId);

    /**
     *
     * @param userId
     * @return
     */
    @PostMapping("/foodbox/userservice/customerUserUrl/queryUserByUserId")
    CustomUser queryUserByUserId(@RequestBody String userId);

    /**
     * 向学校表中添加学校返回学校ID
     * @param schoolName
     * @return
     */
    @PostMapping("/foodbox/userservice/schoolUrl/addSchool")
    String addSchool(@RequestBody String schoolName);

    /**
     * 根据宿舍号查询学校ID
     * @param dormitoryId
     * @return
     */
    @PostMapping("/foodbox/userservice/schoolUrl/querySchoolIdByDormitoryId")
    String querySchoolIdByDormitoryId(@RequestBody String dormitoryId);
}
